<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class DMA extends CI_Controller {
    
    public function __construct() {
        require_once(APPPATH.'libraries/FirePHPCore/FirePHP.class.php');
        ob_start();
        parent::__construct();
        $this->load->helper('asset');
        //$this->load->library('parser');
        $options = array('maxObjectDepth' => 20,
                 'maxArrayDepth' => 20,
                 'maxDepth' => 40,
                 'useNativeJsonEncode' => true,
                 'includeLineNumbers' => true);
        $this->firephp = FirePHP::getInstance(true);
        $this->firephp->getOptions();
        $this->firephp->setOptions($options);
    }

    public function index()
    {  
        //echo css('fluid/reset.css');

        //echo asset_path() . '/docs/download.pdf';
        //exit;
        //$this->load->view('layout/body');
    }
    
    public function ShowNodeTable()
    {
        $css[]['src']="jquery/jqueryui/smoothness/jquery-ui-1.8.16.custom.css";
        $css[]['src']="jquery/jquerytree/css/jquery.treeTable.css";
        $css[]['src']="jquery/jquerytree/css/master.css";
        $js[]['src']="jquery/jquery-1.6.3.min.js";
        $js[]['src']="jquery/jqueryui/jquery-ui-1.8.16.custom.min.js";
        $js[]['src']="jquery/jquerytree/js/jquery.treeTable.min.js";
        
        //$this->firephp->log($js);
        $data['menu_active']=3;
        $data['css']=$css;
        $data['js']=$js;
        $data['page']['title'] = 'My Blog Title';
        $data['page']['heading'] = 'My Blog Heading';
        
        $this->load->view('layout/header',$data);
        $this->load->view('dma/dmatable',$data);
        $this->load->view('layout/footer',$data);
    }
    
    public function ShowNodeGraph()
    {
       // $css[]['src']="jquery/jqueryui/smoothness/jquery-ui-1.8.16.custom.css";
        //$css[]['src']="jquery/jquerytree/css/jquery.treeTable.css";
        //$css[]['src']="jquery/jquerytree/css/master.css";
       // $css[]['src']="js/Jit/css/base.css";
        //$css[]['src']="js/Jit/css/Spacetree.css";

        //$js[]['src']="jquery/jquery-1.6.4.min.js";
        //$js[]['src']="jquery/jqueryui/jquery-ui-1.8.16.custom.min.js";
        //$js[]['src']="js/Jit/jit.js";
        //$js[]['src']="js/shownode.js";
        
        //$this->firephp->log($js);
        $data['menu_active']=2;
        //$data['css']=$css;
        //$data['js']=$js;
        $data['page']['title'] = 'My Blog Title';
        $data['page']['heading'] = 'My Blog Heading';
        
        $this->load->view('layout/header',$data);
        $this->load->view('dma/dmagaph',$data);
        $this->load->view('layout/footer',$data);
    }
    
     public function ShowDMAGraph()
    {
        //$css[]['src']="jquery/jqueryui/smoothness/jquery-ui-1.8.16.custom.css";
        //$css[]['src']="jquery/jquerytree/css/jquery.treeTable.css";
        //$css[]['src']="jquery/jquerytree/css/master.css";
        $css[]['src']="js/Jit/css/base.css";
        $css[]['src']="js/Jit/css/Spacetree.css";

        $js[]['src']="jquery/jquery-1.6.4.min.js";
        $js[]['src']="jquery/jqueryui/jquery-ui-1.8.16.custom.min.js";
        $js[]['src']="js/Jit/jit.js";
        $js[]['src']="js/shownode.js";
        
        //$this->firephp->log($js);
        $data['css']=$css;
        $data['js']=$js;
        $data['menu_active']=1;
        $data['page']['title'] = 'My Blog Title';
        $data['page']['heading'] = 'My Blog Heading';
        

        $this->load->view('dma/spaceGraph',$data);
  
    }
    
    public function Data()
    {
        //header('Expires: ' . gmdate('r', 0));
        //header('Content-type: application/json');
        
        $json ='{
        "id": "node02",
        "name": "DMA",
        "data": {"press": "1.3455"},
        "children": [{
			"id": "node1",
            "name": "DMA1",
            "data": {},
            "children": [{
                "id": "node1-1",
                "name": "DMA1-1",
                "data": {},
                "children": [{
                    "id": "node1-1-1",
                    "name": "DMA1-1-1",
                    "data": {},
                    "children": [{
                        "id": "node1-1-1-1",
                        "name": "DMA1-1-1-1",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node1-1-2",
                    "name": "DMA1-1-2",
                    "data": {},
                    "children": [{
                        "id": "node1-1-2-1",
                        "name": "DMA1-1-2-1",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-2-2",
                        "name": "DMA1-1-2-2",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-2-3",
                        "name": "DMA1-1-2-3",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-2-4",
                        "name": "DMA1-1-2-4",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node1-1-3",
                    "name": "DMA1-1-3",
                    "data": {},
                    "children": [{
                        "id": "node1-1-3-1",
                        "name": "DMA1-1-3-1",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node1-1-4",
                    "name": "DMA1-1-4",
                    "data": {},
                    "children": [{
                        "id": "node1-1-4-1",
                        "name": "DMA1-1-4-1",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-4-2",
                        "name": "DMA1-1-4-2",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-4-3",
                        "name": "DMA1-1-4-3",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-4-4",
                        "name": "DMA1-1-4-4",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node1-1-5",
                    "name": "DMA1-1-5",
                    "data": {},
                    "children": [{
                        "id": "node1-1-5-1",
                        "name": "DMA1-1-5-1",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node1-1-5-2",
                        "name": "DMA1-1-5-2",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node222",
                "name": "2.22",
                "data": {},
                "children": [{
                    "id": "node323",
                    "name": "3.23",
                    "data": {},
                    "children": [{
                        "id": "node424",
                        "name": "4.24",
                        "data": {},
                        "children": []
                    }]
                }]
            }]
        }, {
            "id": "node2",
            "name": "DMA2",
            "data": {},
            "children": [{
                "id": "node2-1",
                "name": "dma2-1",
                "data": {},
                "children": [{
                    "id": "node327",
                    "name": "3.27",
                    "data": {},
                    "children": [{
                        "id": "node428",
                        "name": "4.28",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node429",
                        "name": "4.29",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node330",
                    "name": "3.30",
                    "data": {},
                    "children": [{
                        "id": "node431",
                        "name": "4.31",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node332",
                    "name": "3.32",
                    "data": {},
                    "children": [{
                        "id": "node433",
                        "name": "4.33",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node434",
                        "name": "4.34",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node435",
                        "name": "4.35",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node436",
                        "name": "4.36",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node237",
                "name": "2.37",
                "data": {},
                "children": [{
                    "id": "node338",
                    "name": "3.38",
                    "data": {},
                    "children": [{
                        "id": "node439",
                        "name": "4.39",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node440",
                        "name": "4.40",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node441",
                        "name": "4.41",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node342",
                    "name": "3.42",
                    "data": {},
                    "children": [{
                        "id": "node443",
                        "name": "4.43",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node344",
                    "name": "3.44",
                    "data": {},
                    "children": [{
                        "id": "node445",
                        "name": "4.45",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node446",
                        "name": "4.46",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node447",
                        "name": "4.47",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node348",
                    "name": "3.48",
                    "data": {},
                    "children": [{
                        "id": "node449",
                        "name": "4.49",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node450",
                        "name": "4.50",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node451",
                        "name": "4.51",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node452",
                        "name": "4.52",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node453",
                        "name": "4.53",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node354",
                    "name": "3.54",
                    "data": {},
                    "children": [{
                        "id": "node455",
                        "name": "4.55",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node456",
                        "name": "4.56",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node457",
                        "name": "4.57",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node258",
                "name": "2.58",
                "data": {},
                "children": [{
                    "id": "node359",
                    "name": "3.59",
                    "data": {},
                    "children": [{
                        "id": "node460",
                        "name": "4.60",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node461",
                        "name": "4.61",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node462",
                        "name": "4.62",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node463",
                        "name": "4.63",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node464",
                        "name": "4.64",
                        "data": {},
                        "children": []
                    }]
                }]
            }]
        }, {
            "id": "node3",
            "name": "DMA3",
            "data": {},
            "children": [{
                "id": "node266",
                "name": "2.66",
                "data": {},
                "children": [{
                    "id": "node367",
                    "name": "3.67",
                    "data": {},
                    "children": [{
                        "id": "node468",
                        "name": "4.68",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node469",
                        "name": "4.69",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node470",
                        "name": "4.70",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node471",
                        "name": "4.71",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node372",
                    "name": "3.72",
                    "data": {},
                    "children": [{
                        "id": "node473",
                        "name": "4.73",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node474",
                        "name": "4.74",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node475",
                        "name": "4.75",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node476",
                        "name": "4.76",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node377",
                    "name": "3.77",
                    "data": {},
                    "children": [{
                        "id": "node478",
                        "name": "4.78",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node479",
                        "name": "4.79",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node380",
                    "name": "3.80",
                    "data": {},
                    "children": [{
                        "id": "node481",
                        "name": "4.81",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node482",
                        "name": "4.82",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node283",
                "name": "2.83",
                "data": {},
                "children": [{
                    "id": "node384",
                    "name": "3.84",
                    "data": {},
                    "children": [{
                        "id": "node485",
                        "name": "4.85",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node386",
                    "name": "3.86",
                    "data": {},
                    "children": [{
                        "id": "node487",
                        "name": "4.87",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node488",
                        "name": "4.88",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node489",
                        "name": "4.89",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node490",
                        "name": "4.90",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node491",
                        "name": "4.91",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node392",
                    "name": "3.92",
                    "data": {},
                    "children": [{
                        "id": "node493",
                        "name": "4.93",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node494",
                        "name": "4.94",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node495",
                        "name": "4.95",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node496",
                        "name": "4.96",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node397",
                    "name": "3.97",
                    "data": {},
                    "children": [{
                        "id": "node498",
                        "name": "4.98",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node399",
                    "name": "3.99",
                    "data": {},
                    "children": [{
                        "id": "node4100",
                        "name": "4.100",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4101",
                        "name": "4.101",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4102",
                        "name": "4.102",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4103",
                        "name": "4.103",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node2104",
                "name": "2.104",
                "data": {},
                "children": [{
                    "id": "node3105",
                    "name": "3.105",
                    "data": {},
                    "children": [{
                        "id": "node4106",
                        "name": "4.106",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4107",
                        "name": "4.107",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4108",
                        "name": "4.108",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node2109",
                "name": "2.109",
                "data": {},
                "children": [{
                    "id": "node3110",
                    "name": "3.110",
                    "data": {},
                    "children": [{
                        "id": "node4111",
                        "name": "4.111",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4112",
                        "name": "4.112",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node3113",
                    "name": "3.113",
                    "data": {},
                    "children": [{
                        "id": "node4114",
                        "name": "4.114",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4115",
                        "name": "4.115",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4116",
                        "name": "4.116",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node3117",
                    "name": "3.117",
                    "data": {},
                    "children": [{
                        "id": "node4118",
                        "name": "4.118",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4119",
                        "name": "4.119",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4120",
                        "name": "4.120",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4121",
                        "name": "4.121",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node3122",
                    "name": "3.122",
                    "data": {},
                    "children": [{
                        "id": "node4123",
                        "name": "4.123",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4124",
                        "name": "4.124",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node2125",
                "name": "2.125",
                "data": {},
                "children": [{
                    "id": "node3126",
                    "name": "3.126",
                    "data": {},
                    "children": [{
                        "id": "node4127",
                        "name": "4.127",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4128",
                        "name": "4.128",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4129",
                        "name": "4.129",
                        "data": {},
                        "children": []
                    }]
                }]
            }]
        }, {
            "id": "node4",
            "name": "DMA4",
            "data": {},
            "children": [{
                "id": "node2131",
                "name": "2.131",
                "data": {},
                "children": [{
                    "id": "node3132",
                    "name": "3.132",
                    "data": {},
                    "children": [{
                        "id": "node4133",
                        "name": "4.133",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4134",
                        "name": "4.134",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4135",
                        "name": "4.135",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4136",
                        "name": "4.136",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4137",
                        "name": "4.137",
                        "data": {},
                        "children": []
                    }]
                }]
            }, {
                "id": "node2138",
                "name": "2.138",
                "data": {},
                "children": [{
                    "id": "node3139",
                    "name": "3.139",
                    "data": {},
                    "children": [{
                        "id": "node4140",
                        "name": "4.140",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4141",
                        "name": "4.141",
                        "data": {},
                        "children": []
                    }]
                }, {
                    "id": "node3142",
                    "name": "3.142",
                    "data": {},
                    "children": [{
                        "id": "node4143",
                        "name": "4.143",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4144",
                        "name": "4.144",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4145",
                        "name": "4.145",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4146",
                        "name": "4.146",
                        "data": {},
                        "children": []
                    }, {
                        "id": "node4147",
                        "name": "4.147",
                        "data": {},
                        "children": []
                    }]
                }]
            }]
        }]
    }';
       
    echo $json ;
    //var_dump(json_decode($json, true));
    //$this->firephp->log("ss");
    //$this->firephp->log(json_decode($json, true));
    /*
        switch (json_last_error()) {
            case JSON_ERROR_NONE:
                echo ' - No errors';
            break;
            case JSON_ERROR_DEPTH:
                echo ' - Maximum stack depth exceeded';
            break;
            case JSON_ERROR_STATE_MISMATCH:
                echo ' - Underflow or the modes mismatch';
            break;
            case JSON_ERROR_CTRL_CHAR:
                echo ' - Unexpected control character found';
            break;
            case JSON_ERROR_SYNTAX:
                echo ' - Syntax error, malformed JSON';
            break;
            case JSON_ERROR_UTF8:
                echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
            break;
            default:
                echo ' - Unknown error';
            break;
        }
     * */

    }
    
    
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */